#include <iostream>
#include <string>

using namespace std;
struct student
{
    string name;
    int age;
    int score;
} stu3; // 创建方式的一种，直接在后面跟上

int main(int argc, char const *argv[])
{
    struct student stu1; // struct 可以省略写为 student stu1;
    stu1.name = "张三";
    stu1.age = 20;
    stu1.score = 100;

    cout << "Student: \t stu1" << endl;
    cout << "Name: \t" << stu1.name << endl;
    cout << "Age: \t" << stu1.age << endl;
    cout << "Score: \t" << stu1.score << endl;

    student stu2 = {"李四", 24, 150}; // 此时 struct 省略来写了

    cout << "Student: \t stu2" << endl;
    cout << "Name: \t" << stu2.name << endl;
    cout << "Age: \t" << stu2.age << endl;
    cout << "Score: \t" << stu2.score << endl;

    stu3.name = "王五";
    stu3.age = 50;
    stu3.score = 66;

    cout << "Student: \t stu3" << endl;
    cout << "Name: \t" << stu3.name << endl;
    cout << "Age: \t" << stu3.age << endl;
    cout << "Score: \t" << stu3.score << endl;


    struct person
    {
        string name = "lucy";
        string sex = "女";
    } lucy;

    cout << lucy.name << endl;
    cout << lucy.sex << endl;

    lucy.name = "Sam";
    lucy.sex = "男";
    
    cout << lucy.name << endl;
    cout << lucy.sex << endl;
    

    return 0;
}
